package com.glsc.ngateway.common.api.flowable.dto.task.formData.equipment;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.AbstractTaskFormDataDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.equipment.domainDto.FlowFormEquipmentServerApplyDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.equipment.domainDto.FlowFormEquipmentServerApplyServerDetailDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.util.List;
import java.util.Objects;

/**
 * 设备流程-物理设备申领及上架流程表单数据
 * @author xuchang
 */
@ToString(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper=true)
public class EquipmentServerApplyTaskFormDataDto extends AbstractTaskFormDataDto<FlowFormEquipmentServerApplyDto>{

    @ApiModelProperty(value = "子表-虚拟机")
    List<FlowFormEquipmentServerApplyServerDetailDto> formServerDataList;

    @Override
    public String getSystemAdminAccount() {
        return this.getFormMainData().getSystemAdminAccount();
    }

    @Override
    public String getProcessTitle() {
        return this.getFormMainData().getProcessTitle();
    }

    @Override
    public void setProcessId(String processId) {
        if(Objects.nonNull(this.getFormMainData())) {
            this.getFormMainData().setProcessId(processId);
        }
    }

    @Override
    public String getProcessId() {
        return this.getFormMainData().getProcessId();
    }

}
